package com.dayuanit.mars.car;

import com.dayuanit.mars.map.Point;
import com.dayuanit.mars.map.MarsMap;
import com.dayuanit.mars.auto.Engine;

public class MarsCar {
	private String name;
	private Point point;
	private Engine engine;
	
	public MarsCar(String name) {
		this.name = name;
		this.point = new Point();
	}

	public void processes(String ... orders) {
		for (String order : orders) {
			process(order);
		}
	}

	public void process(String order) {
		System.out.println(order);
			
		engine = new Engine();
		engine.run(point, order);

		System.out.println(point.getXpoint() + ", " + point.getYpoint());
	}

	public String getName() {
		return name;
	}
}